#pragma once
#include "q_shared.h"
#include "bg_global.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "CVec3.h"

#define NUM_NODES	1024

/*namespace NAV
{
	typedef		int		TNodeHandle;
	typedef		int		TEdgeHandle;


	enum	EPointType
	{
		PT_NONE = 0,

		PT_WAYNODE,
		PT_COMBATNODE,
		PT_GOALNODE,

		PT_MAX
	};




	////////////////////////////////////////////////////////////////////////////////////
	// Save, Load, Construct
	////////////////////////////////////////////////////////////////////////////////////
	qboolean		LoadFromFile(const char *filename, int checksum);
	qboolean		TestEdge( TNodeHandle NodeA, TNodeHandle NodeB, qboolean IsDebugEdge );
	qboolean		LoadFromEntitiesAndSaveToFile(const char *filename, int checksum);
	void			SpawnedPoint(gentity_t* ent, EPointType type=PT_WAYNODE);


	////////////////////////////////////////////////////////////////////////////////////
	// Finding Nav Points
	////////////////////////////////////////////////////////////////////////////////////
	TNodeHandle		GetNearestNode(gentity_t* ent, bool forceRecalcNow=false, NAV::TNodeHandle goal=0);
	TNodeHandle		GetNearestNode(const vec3_t& position, TNodeHandle previous=0, NAV::TNodeHandle goal=0, int ignoreEnt=ENTITYNUM_NONE, bool allowZOffset=false);

	TNodeHandle		ChooseRandomNeighbor(TNodeHandle NodeHandle);
	TNodeHandle		ChooseRandomNeighbor(TNodeHandle NodeHandle, const vec3_t& position, float maxDistance);
	TNodeHandle		ChooseClosestNeighbor(TNodeHandle NodeHandle, const vec3_t& position);
	TNodeHandle		ChooseFarthestNeighbor(TNodeHandle NodeHandle, const vec3_t& position);
	TNodeHandle		ChooseFarthestNeighbor(gentity_t* actor, const vec3_t& target, float maxSafeDot);


	////////////////////////////////////////////////////////////////////////////////////
	// Get The Location Of A Given Node Handle
	////////////////////////////////////////////////////////////////////////////////////
	const vec3_t&	GetNodePosition(TNodeHandle NodeHandle);
	void			GetNodePosition(TNodeHandle NodeHandle, vec3_t& position);


	////////////////////////////////////////////////////////////////////////////////////
	// Testing Nearness
	////////////////////////////////////////////////////////////////////////////////////
	float			EstimateCostToGoal(const vec3_t& position, TNodeHandle Goal);
	float			EstimateCostToGoal(TNodeHandle Start, TNodeHandle Goal);

	qboolean		OnSamePoint(gentity_t* actor, gentity_t* target);
	qboolean		OnNeighboringPoints(TNodeHandle A, TNodeHandle B);
	qboolean		OnNeighboringPoints(gentity_t* actor, gentity_t* target);
	qboolean		OnNeighboringPoints(gentity_t* actor, const vec3_t& position);
	qboolean		InSameRegion(gentity_t* actor, gentity_t* target);
	qboolean		InSameRegion(gentity_t* actor, const vec3_t& position);
	qboolean		InSameRegion(TNodeHandle A, TNodeHandle B);

	qboolean		InSafeRadius(CVec3 at, TNodeHandle atNode, TNodeHandle targetNode=0);

	////////////////////////////////////////////////////////////////////////////////////
	// Finding A Path
	////////////////////////////////////////////////////////////////////////////////////
	qboolean		GoTo(gentity_t* actor, TNodeHandle target, float MaxDangerLevel=1.0f);
	qboolean		GoTo(gentity_t* actor, gentity_t* target, float MaxDangerLevel=1.0f);
	qboolean		GoTo(gentity_t* actor, const vec3_t& position, float MaxDangerLevel=1.0f);

	qboolean		FindPath(gentity_t* actor, TNodeHandle target, float MaxDangerLevel=1.0f);
	qboolean		FindPath(gentity_t* actor, gentity_t* target, float MaxDangerLevel=1.0f);
	qboolean		FindPath(gentity_t* actor, const vec3_t& position, float MaxDangerLevel=1.0f);

	qboolean		SafePathExists(const CVec3& start, const CVec3& stop, const CVec3& danger, float dangerDistSq);

	qboolean		HasPath(gentity_t* actor, TNodeHandle target=PT_NONE);
	void			ClearPath(gentity_t* actor);
	qboolean		UpdatePath(gentity_t* actor, TNodeHandle target=PT_NONE, float MaxDangerLevel=1.0f);
	float			PathDangerLevel(gentity_t* actor);
	int				PathNodesRemaining(gentity_t* actor);

	const vec3_t&	NextPosition(gentity_t* actor);
	qboolean		NextPosition(gentity_t* actor, CVec3& Position);
	qboolean		NextPosition(gentity_t* actor, CVec3& Position, float& SlowingRadius, bool& Fly, bool& Jump);


	////////////////////////////////////////////////////////////////////////////////////
	// Update One Or More Edges As A Result Of An Entity Getting Removed
	////////////////////////////////////////////////////////////////////////////////////
	void			WayEdgesNowClear(gentity_t* ent);


	////////////////////////////////////////////////////////////////////////////////////
	// How Big Is The Given Ent
	////////////////////////////////////////////////////////////////////////////////////
	unsigned int	ClassifyEntSize(gentity_t* ent);
	void			RegisterDangerSense(gentity_t* actor, int alertEventIndex);
	void			DecayDangerSenses();


	////////////////////////////////////////////////////////////////////////////////////
	// Debugging Information
	////////////////////////////////////////////////////////////////////////////////////
	void			ShowDebugInfo(const vec3_t& PlayerPosition, TNodeHandle PlayerWaypoint);
	void			ShowStats();

	void			TeleportTo(gentity_t* actor, const char* pointName);
	void			TeleportTo(gentity_t* actor, int pointNum);
};*/